/**
 * 
 */
package evolution;

import java.util.Comparator;

/**
 * @author Alon Segal
 *
 */
public class IndividualComparator implements Comparator<Individual> {

	/**
	 * 
	 */
	public IndividualComparator() {
	}

	@Override
	public int compare(Individual arg0, Individual arg1) {
		double tmp = arg0.getFitness() - arg1.getFitness();
		if (tmp == 0) return 0;
		return (tmp > 0) ? 1 : -1;
	}

	
}
